<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="../style.css" type="text/css" media="all" />
<body>
<h1>Array2XML</h1>
<div class="class_description">Представляет массив в виде XML-таблицы</div>
<h2>Методы</h2><ul><li><a href="#__construct">__construct</a></li><li><a href="#__toString">__toString</a></li><li><a href="#__toXML">__toXML</a></li></ul><a name="__construct"></a>
<h3>__construct</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">void</span> <span class="name">__construct</span> (<span class="type">string</span> <span class="varname">$tagName</span>, <span class="type">array</span> <span class="varname">$data</span>)</div><p>Конструктор</p>
</div>
</div><div class="block parametrs">
<h4>Параметры</h4>
<div class="text parametrs"><dl class="var_description">
	<dt>tagName</dt>
	<dd>название корневого элемента, относительно которого будет построено дерево</dd>
</dl>
</div>
</div><a name="__toString"></a>
<h3>__toString</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">string</span> <span class="name">__toString</span> ()</div><p>Возвращает текст XML-таблицы, построенной на основе массива</p>
</div>
</div><a name="__toXML"></a>
<h3>__toXML</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">DOMElement</span> <span class="name">__toXML</span> (<span class="type">DOMDocument</span> <span class="varname">$xml</span>)</div><p>Возвращает XML-таблицу</p>
</div>
</div><h2>Примеры</h2><div class="sample">
<p>Пример №1</p>
<div class="sample_content"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;В&nbsp;методе&nbsp;некого&nbsp;модуля...<br /><br /></span><span style="color: #0000BB">$a&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Array2XML&nbsp;</span><span style="color: #007700">(<br />&nbsp;&nbsp;</span><span style="color: #DD0000">'data'</span><span style="color: #007700">,<br />&nbsp;&nbsp;array&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'foo'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array&nbsp;(</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'bar'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'test'<br />&nbsp;&nbsp;</span><span style="color: #007700">)<br />);<br /><br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">flush&nbsp;</span><span style="color: #007700">((string)&nbsp;</span><span style="color: #0000BB">$a</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'text/xml'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Результат<br />&lt;?xml&nbsp;version="1.0"&nbsp;encoding="utf-8"?&gt;<br />&lt;data&gt;<br />&nbsp;&nbsp;&lt;foo&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;1&lt;/value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;2&lt;/value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;3&lt;/value&gt;<br />&nbsp;&nbsp;&lt;/foo&gt;<br />&nbsp;&nbsp;&lt;bar&gt;test&lt;/bar&gt;<br />&lt;/data&gt;<br />*/<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
</div></body>
</html>